<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>文章评论管理</title>

<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}

.tabfont01 {
	font-family: "宋体";
	font-size: 9px;
	color: #555555;
	text-decoration: none;
	text-align: center;
}

.font051 {
	font-family: "宋体";
	font-size: 12px;
	color: #333333;
	text-decoration: none;
	line-height: 20px;
}

.font201 {
	font-family: "宋体";
	font-size: 12px;
	color: #FF0000;
	text-decoration: none;
}

.button {
	font-family: "宋体";
	font-size: 14px;
	height: 37px;
}

html {
	overflow-x: auto;
	overflow-y: auto;
	border: 0;
}
-->
</style>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />  
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>  
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>  
<script>  
	$(function() {    
		$( "#beginDate" ).datepicker({ dateFormat: "yy-mm-dd" });  
		$( "#endDate" ).datepicker({ dateFormat: "yy-mm-dd" });  
	}); 
</script>

<link rel="stylesheet" href="jquery-validation/screen.css" />
<link href="css/css.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="jquery.validate.min.js"></script>
<script type="text/javascript" src="WarnMessages.js"></script>
<script type="text/javascript" src="layer-v1.5.1/layer/layer.min.js"></script>
<script type="text/javascript">
	//全选
	function checkAll(name) {
		var names = document.getElementsByName(name);
		var len = names.length;
		if (len > 0) {
			for ( var i = 0; i < len; i++) {
				names[i].checked = true;
			}
		}
	}

	//全不选
	function checkAllNo(name) {
		var names = document.getElementsByName(name);
		var len = names.length;
		if (len > 0) {
			for ( var i = 0; i < len; i++) {
				names[i].checked = false;
			}
		}
	}

	//反选
	function reserveCheck(name) {
		var names = document.getElementsByName(name);
		var len = names.length;
		if (len > 0) {
			var i = 0;
			for (i = 0; i < len; i++) {
				if (names[i].checked) {
					names[i].checked = false;
				} else {
					names[i].checked = true;
				}
			}
		}
	}

	function XXX() {
		$.layer({
			area   : ['auto','auto'],
			dialog : {
				msg:'是否删除，删除之后不能恢复',
				type : 8,
				yes    : function(index){
					var chk_value =[];   
         			$('input[name="adminIdStr"]:checked').each(function(){   
              			chk_value.push($(this).val());   
         			});   
         			if(chk_value.length==0) {
         				return;
         			} 
					window.location.href="deleteComment?commentId="+ chk_value;
				},
				no    : function(index) {
			 		return;
				}	
			}
			
		});
	}
</script>

<script type="text/javascript">
	$(function() {
		$("#addAdmin").click(function() { window.location.href = "adminmanage/AdminAdd.jsp"; });
		/*****以上是跳转***/
		$("#myform").validate({
			rules : {
				'user.name' : {
					required : true,
					minlength : 2
				},
				age : {
					required : true,
					minlength : 2
				},
				url : {
					required : true,
					minlength : 2
				},
				email : {
					required : true,
					minlength : 2
				},
				psdone : {
					required : true
				},
				psdtwo : {
					required : true,
					equalTo : '#psdone'
				}
			},
			btnSubmit : {
				submitHandler : function(form) {
					alert("submitted");
					form.submit();
				}
			}
		});
		/*****以上是表单验证****/
	});
	function delAlert(id) {
		 var chk_value =[];   
         $('input[name="adminIdStr"]:checked').each(function(){   
              chk_value.push($(this).val());   
         });   
         alert(chk_value.length==0 ?'你还没有选择任何内容！':chk_value);   
	}
</script>
</head>
<body>
	<table id="mainpage" width="100%" border="0" cellspacing="0" cellpadding="0">
		<tr>
			<td height="30">
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td height="62" background="images/nav04.gif">
							
								<table>
									<tr height="30px">
										<td>
											<span class="newfont07">&nbsp;&nbsp;&nbsp;&nbsp;选择：
												<input type="radio" name="choice" id="ckall" onclick="checkAll('adminIdStr','ckall')" />全选
												<input type="radio"  name="choice" id="ckReserve" onclick="reserveCheck('adminIdStr','ckReserve')" />反选
												<input name="Submit" type="button" onclick="XXX()" class="right-button08" value="删除" /> 
						    				</span>
						    			</td>
										<td width="30">&nbsp;</td>
									    <td align="right"  width="90px">开始时间:</td>
									    <form action="admin/CommentfindByDate" method="post">
										    <td>
										    	<input type="text" id="beginDate" name="beginDate"/>&nbsp;&nbsp;&nbsp;&nbsp;结束时间:
										    	<input type="text" id="endDate" name="endDate"/>
										    </td>
										    <td><input type="submit" value="搜索"/></td>
									    </form>
									</tr>
								</table>
							
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td>
				<table id="subtree1" style="DISPLAY: " width="100%" border="0" cellspacing="0" cellpadding="0">
					<tr>
						<td>
							<table width="95%" border="0" align="center" cellpadding="0" cellspacing="0">
								<tr>
									<td height="40" class="font42">
										<form action="admin/admindeleteAdmin" name="checkIds">
										<table width="100%" border="0" cellpadding="4" align="center" cellspacing="1" bgcolor="#464646" class="newfont03">
											<tr>
												<td height="20" colspan="5" align="center" bgcolor="#EEEEEE" class="tablestyle_title" >管理员列表</td>
											</tr>
											<tr>
												<td width="3%" align="center" bgcolor="#EEEEEE">选择</td>
												<td width="15%" align="center" bgcolor="#EEEEEE">文章标题</td>
												<td width="70%" align="center" bgcolor="#EEEEEE">评论</td>
												<td width="5%" align="center" bgcolor="#EEEEEE">时间</td>
											</tr>
											<c:forEach items="${requestScope.pages.records}" var="comment">
											<tr align="center">
												<td width="4%" align="center" bgcolor="#EEEEEE"><input type="checkbox" name="adminIdStr"  value="${comment.commentId }"/></td>
												<td width="17%" align="center" bgcolor="#EEEEEE"> ${comment.artical.title}</td>
												<td width="67%" align="center" bgcolor="#EEEEEE">${ comment.content}</td>
												<td width="5%" align="center" bgcolor="#EEEEEE">${ comment.commDate}</td>
											</tr>
											</c:forEach>
										</table>
										</form>
										<jsp:include page="/page.jsp" /> 
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
</body>
</html>
